#define _CRT_SECURE_NO_WARNINGS

#include "Slist.h"

void SListTest()
{
//	SLTNode* SList = NULL;
	SLTNode* node1 = (SLTNode*)malloc(sizeof(SLTNode));
	node1->data = 1;
	SLTNode* node2 = (SLTNode*)malloc(sizeof(SLTNode));
	node2->data = 2;
	SLTNode* node3 = (SLTNode*)malloc(sizeof(SLTNode));
	node3->data = 3;
	SLTNode* node4 = (SLTNode*)malloc(sizeof(SLTNode));
	node4->data = 4;
	node1->next = node2;
	node2->next = node3;
	node3->next = node4;
	node4->next = NULL;
	SLTNode* SList = node1;
	SLTPushBack(&SList, 5);
	SLTPushBack(&SList, 7);
	SLTPushFront(&SList, 9);
	SLTPopBack(&SList);
	SLTPopFront(&SList);
	SLTInsert(&SList, SLTFind(SList, 3), 10);
	SLTInsertAfter(SLTFind(SList, 3), 11);
	SLTErase(&SList, SLTFind(SList, 3));
	SLTEraseAfter(SLTFind(SList, 1));
	SLTPrint(SList);
	SLTDestroy(&SList);
	SLTPrint(SList);
}

int main()
{
	SListTest();

	return 0;
}